package com.health.memberbackstage.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.health.memberbackstage.pojo.Order;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Options;
import org.apache.ibatis.annotations.Param;
import org.springframework.web.bind.annotation.PathVariable;

public interface OrderMapper extends BaseMapper<Order> {

    @Insert("INSERT INTO `order` (name, member_id, orderdate, order_type, setmeal_id, marital_status) VALUES (#{order.name},#{order.memberId},#{order.orderdate},#{order.orderType},#{order.setmealId},#{order.maritalStatus})")
    @Options(useGeneratedKeys = true,keyProperty = "id")
    int insertOrder(@Param("order") Order order);

    @Insert("insert into order_report values(#{oid},#{rid})")
    int insertOR(@Param("oid") Integer oid,@Param("rid") Integer rid);
}
